package com.sanda.rongbaoqing.restcontroller;

import com.sanda.chengzhihao.pojo.BaseResponse;
import com.sanda.chengzhihao.pojo.UserInfo;
import com.sanda.chengzhihao.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
public class HelloRestController {
    @Autowired
    HelloService helloService;

    @RequestMapping("/get_user_info")
    com.sanda.rongbaoqing.pojo.BaseResponse<List<UserInfo>> getUserInfo() {
        List<UserInfo> userInfo = helloService.getUserInfo();
        return com.sanda.rongbaoqing.pojo.BaseResponse.success(userInfo, userInfo.size());
    }
}
